<div *ngIf="params.data.id > -1">
  <div *ngIf="source === navSource.FED_POLICY; then onFed else notOnFed"></div>
</div>

<ng-template #onFed>
  <div *ngIf="params.data.cfg_type === cfgType.GROUND; then readonlyRule else writableRule"></div>
</ng-template>

<ng-template #notOnFed>
  <div *ngIf="params.data.cfg_type === cfgType.GROUND || params.data.cfg_type === cfgType.FED || (params.data.disable && params.data.cfg_type === cfgType.FED); then readonlyRule else writableRule"></div>
</ng-template>

<ng-template #writableRule>
  <div *ngIf="params.value >= newIdSeed.NETWORK_RULE; then newRule else newRuleElse"></div>
</ng-template>

<ng-template #newRule>
  <div>
    <span
      [ngClass]="{'policy-remove': params.data.remove}"
      matTooltip="{{params.data.comment}}"
    >
      {{'New-' + (params.value - newIdSeed.NETWORK_RULE + 1)}}
    </span>
  </div>
</ng-template>

<ng-template #newRuleElse>
  <div>
    <span
      [ngClass]="{'policy-remove': params.data.remove}"
      matTooltip="{{params.data.comment}}"
    >
      {{params.value}}
    </span>
  </div>
</ng-template>

<ng-template #readonlyRule>
  <div>
    <span
      [ngClass]="{'policy-remove': params.data.remove}"
      matTooltip="{{params.data.comment}}"
    >
      {{params.value}}
    </span>
  </div>
</ng-template>
